//
//  UIWebView+EmptyData.m
//  HappyStore
//
//  Created by 陈锋 on 16/5/31.
//  Copyright © 2016年 LLJ. All rights reserved.
//

#import "UIWebView+EmptyData.h"

@implementation UIWebView (EmptyData)
- (void)webViewDisplayWitMsg:(NSString *)message ifNecessaryForRowCount:(NSUInteger)rowCount
{
    if (rowCount < 1) {
        //没有数据的时候，UILabel的显示样式;
        //        UILabel *messageLabel = [UILabel new];
        //        messageLabel.text = message;
        //        messageLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
        //        messageLabel.textColor = [UIColor lightGrayColor];
        //        messageLabel.textAlignment = NSTextAlignmentCenter;
        //        [messageLabel sizeToFit];
        //
        //        self.backgroundView = messageLabel;
        UIImage *imgNo = [UIImage imageNamed:@"icon_wushuju"];
        UIImageView *imgV = [[UIImageView alloc] initWithImage:imgNo];
        //        imgV.frame = (CGRect){(320-168)/2,(self.frame.size.height-130)/2,168,130};
        imgV.contentMode = UIViewContentModeCenter;
        [self addSubview:imgV];
        
        
        //        self.separatorStyle = UITableViewCellSeparatorStyleNone;
        
    }
    else {
//        self.backgroundView = nil;
        //        self.separatorStyle = UITableViewCellSeparatorStyleNone;
    }
}
@end
